<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LINE 1 &quot;libraries\\Win32\\Graphics\\Win32\\Dialogue.hsc&quot; #-}</span><span id="local-6989586621679111428"></span><span>
</span><span id="line-1"></span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LINE 2 &quot;libraries\\Win32\\Graphics\\Win32\\Dialogue.hsc&quot; #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LINE 6 &quot;libraries\\Win32\\Graphics\\Win32\\Dialogue.hsc&quot; #-}</span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  Graphics.Win32.Dialogue</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  (c) Alastair Reid, 1997-2003</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Maintainer  :  Esa Ilari Vuokko &lt;ei@vuokko.info&gt;</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- A collection of FFI declarations for interfacing with Win32.</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Graphics.Win32.Dialogue</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Graphics.Win32.GDI.Types</span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Graphics.Win32.Control</span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Graphics.Win32.Message</span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Graphics.Win32.Window</span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">System.Win32.Types</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign.C</span><span class="hs-cpp">

#include &quot;windows_cconv.h&quot;
</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">DTemplate</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">LPCTSTR</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">DTemplateMem</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">Stub_DTM</span><span>
</span><span id="line-38"></span><span class="hs-keyword">newtype</span><span> </span><span class="hs-identifier">Stub_DTM</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Stub_DTM</span><span> </span><span class="hs-identifier">DTemplateMem</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-keyword">newtype</span><span> </span><span class="hs-identifier">DIA_TEMPLATE</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">DIA_TEMPLATE</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">DIA_TEMPLATE</span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">DialogStyle</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span class="hs-identifier">mkDialogTemplate</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DTemplate</span><span>
</span><span id="line-45"></span><span class="hs-identifier">mkDialogTemplate</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">newTString</span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">ResourceID</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-identifier">mkResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">ResourceID</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">a</span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span class="hs-identifier">mkResource</span><span> </span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">return</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">castUINTPtrToPtr</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-identifier">res</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span class="hs-identifier">mkDialogTemplateFromResource</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DTemplate</span><span>
</span><span id="line-53"></span><span class="hs-identifier">mkDialogTemplateFromResource</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">mkResource</span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WindowMessage</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-identifier">marshall_dialogProc_</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">FunPtr</span><span> </span><span class="hs-identifier">DialogProc</span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span class="hs-identifier">marshall_dialogProc_</span><span> </span><span class="hs-identifier">cl</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">mkDialogClosure</span><span> </span><span class="hs-identifier">cl</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-comment">-- ToDo: this was declared as a stdcall not a ccall - let's</span><span>
</span><span id="line-61"></span><span class="hs-comment">-- hope and pray that it makes no difference - ADR</span><span>
</span><span id="line-62"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">ccall</span><span> </span><span class="hs-string">&quot;wrapper&quot;</span><span>
</span><span id="line-63"></span><span>  </span><span class="hs-identifier">mkDialogClosure</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">FunPtr</span><span> </span><span class="hs-identifier">DialogProc</span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-identifier">dialogBox</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplate</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-66"></span><span class="hs-identifier">dialogBox</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-67"></span><span>  </span><span class="hs-identifier">dialogBoxParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-number">0</span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-identifier">dialogBoxParam</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplate</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-70"></span><span class="hs-identifier">dialogBoxParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-identifier">init_val</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-71"></span><span>  </span><span class="hs-identifier">c_dia_fn</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">mkDialogClosure</span><span> </span><span class="hs-identifier">dia_fn</span><span>
</span><span id="line-72"></span><span>  </span><span class="hs-identifier">failIf</span><span> </span><span class="hs-special">(</span><span class="hs-operator">==</span><span> </span><span class="hs-glyph">-</span><span class="hs-number">1</span><span class="hs-special">)</span><span> </span><span class="hs-string">&quot;DialogBoxParam&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-73"></span><span>    </span><span class="hs-identifier">c_DialogBoxParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">maybePtr</span><span> </span><span class="hs-identifier">mb_parent</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">c_dia_fn</span><span> </span><span class="hs-identifier">init_val</span><span>
</span><span id="line-74"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h DialogBoxParamW&quot;</span><span>
</span><span id="line-75"></span><span>  </span><span class="hs-identifier">c_DialogBoxParam</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplate</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">FunPtr</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span class="hs-identifier">dialogBoxIndirect</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplateMem</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-78"></span><span class="hs-identifier">dialogBoxIndirect</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-79"></span><span>  </span><span class="hs-identifier">dialogBoxIndirectParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-number">0</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-identifier">dialogBoxIndirectParam</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplateMem</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-82"></span><span class="hs-identifier">dialogBoxIndirectParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-identifier">init_val</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-83"></span><span>  </span><span class="hs-identifier">c_dia_fn</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">mkDialogClosure</span><span> </span><span class="hs-identifier">dia_fn</span><span>
</span><span id="line-84"></span><span>  </span><span class="hs-identifier">failIf</span><span> </span><span class="hs-special">(</span><span class="hs-operator">==</span><span> </span><span class="hs-glyph">-</span><span class="hs-number">1</span><span class="hs-special">)</span><span> </span><span class="hs-string">&quot;DialogBoxIndirectParam&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-85"></span><span>    </span><span class="hs-identifier">c_DialogBoxIndirectParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">maybePtr</span><span> </span><span class="hs-identifier">mb_parent</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">c_dia_fn</span><span> </span><span class="hs-identifier">init_val</span><span>
</span><span id="line-86"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h DialogBoxIndirectParamW&quot;</span><span>
</span><span id="line-87"></span><span>  </span><span class="hs-identifier">c_DialogBoxIndirectParam</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplateMem</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">FunPtr</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">DialogTemplate</span><span>
</span><span id="line-91"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">DialogTemplate</span><span>
</span><span id="line-92"></span><span>      </span><span class="hs-identifier">Int</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-identifier">Int</span><span>  </span><span class="hs-comment">-- x, y, cx, cy</span><span>
</span><span id="line-93"></span><span>      </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-94"></span><span>      </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-95"></span><span>      </span><span class="hs-special">(</span><span class="hs-identifier">Either</span><span> </span><span class="hs-identifier">ResourceID</span><span> </span><span class="hs-identifier">String</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- menu</span><span>
</span><span id="line-96"></span><span>      </span><span class="hs-special">(</span><span class="hs-identifier">Either</span><span> </span><span class="hs-identifier">ResourceID</span><span> </span><span class="hs-identifier">String</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- class</span><span>
</span><span id="line-97"></span><span>      </span><span class="hs-special">(</span><span class="hs-identifier">Either</span><span> </span><span class="hs-identifier">ResourceID</span><span> </span><span class="hs-identifier">String</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- caption</span><span>
</span><span id="line-98"></span><span>      </span><span class="hs-special">(</span><span class="hs-identifier">Either</span><span> </span><span class="hs-identifier">ResourceID</span><span> </span><span class="hs-identifier">String</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- fontname</span><span>
</span><span id="line-99"></span><span>      </span><span class="hs-identifier">Int</span><span>                         </span><span class="hs-comment">-- font height</span><span>
</span><span id="line-100"></span><span>      </span><span class="hs-special">[</span><span class="hs-identifier">DialogControl</span><span class="hs-special">]</span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">DialogControl</span><span>
</span><span id="line-103"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">DialogControl</span><span>
</span><span id="line-104"></span><span>      </span><span class="hs-identifier">Int</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-comment">-- x,y, cx, cy</span><span>
</span><span id="line-105"></span><span>      </span><span class="hs-special">(</span><span class="hs-identifier">Either</span><span> </span><span class="hs-identifier">ResourceID</span><span> </span><span class="hs-identifier">String</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- text</span><span>
</span><span id="line-106"></span><span>      </span><span class="hs-special">(</span><span class="hs-identifier">Either</span><span> </span><span class="hs-identifier">ResourceID</span><span> </span><span class="hs-identifier">String</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- classname</span><span>
</span><span id="line-107"></span><span>      </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-108"></span><span>      </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-109"></span><span>      </span><span class="hs-identifier">Int</span><span>                        </span><span class="hs-comment">-- dia_id</span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span class="hs-identifier">mkDialogFromTemplate</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DialogTemplate</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DTemplateMem</span><span>
</span><span id="line-112"></span><span class="hs-identifier">mkDialogFromTemplate</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">DialogTemplate</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span>
</span><span id="line-113"></span><span>                                     </span><span class="hs-identifier">wstyle</span><span> </span><span class="hs-identifier">extstyle</span><span>
</span><span id="line-114"></span><span>                                     </span><span class="hs-identifier">mb_menu</span><span> </span><span class="hs-identifier">mb_class</span><span> </span><span class="hs-identifier">caption</span><span>
</span><span id="line-115"></span><span>                                     </span><span class="hs-identifier">font</span><span> </span><span class="hs-identifier">font_height</span><span>
</span><span id="line-116"></span><span>                                     </span><span class="hs-identifier">controls</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-117"></span><span>  </span><span class="hs-identifier">prim_hmenu</span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">marshall_res</span><span> </span><span class="hs-identifier">mb_menu</span><span>
</span><span id="line-118"></span><span>  </span><span class="hs-identifier">prim_class</span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">marshall_res</span><span> </span><span class="hs-identifier">mb_class</span><span>
</span><span id="line-119"></span><span>  </span><span class="hs-identifier">prim_caption</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">marshall_res</span><span> </span><span class="hs-identifier">caption</span><span>
</span><span id="line-120"></span><span>  </span><span class="hs-identifier">prim_font</span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">marshall_res</span><span> </span><span class="hs-identifier">font</span><span>
</span><span id="line-121"></span><span>  </span><span class="hs-identifier">dtemp</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">mkDiaTemplate</span><span> </span><span class="hs-number">0</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-identifier">wstyle</span><span> </span><span class="hs-identifier">extstyle</span><span>
</span><span id="line-122"></span><span>                         </span><span class="hs-identifier">prim_hmenu</span><span> </span><span class="hs-identifier">prim_class</span><span>
</span><span id="line-123"></span><span>                         </span><span class="hs-identifier">prim_caption</span><span> </span><span class="hs-identifier">prim_font</span><span>
</span><span id="line-124"></span><span>                         </span><span class="hs-identifier">font_height</span><span>
</span><span id="line-125"></span><span>  </span><span class="hs-identifier">mapM_</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">addControl</span><span> </span><span class="hs-identifier">dtemp</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">controls</span><span>
</span><span id="line-126"></span><span>  </span><span class="hs-identifier">getFinalDialog</span><span> </span><span class="hs-identifier">dtemp</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span class="hs-identifier">pushButtonControl</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-129"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-130"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-131"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogControl</span><span>
</span><span id="line-132"></span><span class="hs-identifier">pushButtonControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-identifier">style</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span> </span><span class="hs-identifier">lab</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-133"></span><span>  </span><span class="hs-identifier">DialogControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Left</span><span> </span><span class="hs-number">0x0080</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">lab</span><span class="hs-special">)</span><span>
</span><span id="line-134"></span><span>                </span><span class="hs-special">(</span><span class="hs-identifier">style</span><span> </span><span class="hs-operator">+</span><span> </span><span class="hs-identifier">bS_DEFPUSHBUTTON</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span class="hs-identifier">labelControl</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-137"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-138"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-139"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogControl</span><span>
</span><span id="line-140"></span><span class="hs-identifier">labelControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-identifier">style</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span> </span><span class="hs-identifier">lab</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-141"></span><span>  </span><span class="hs-identifier">DialogControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Left</span><span> </span><span class="hs-number">0x0082</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">lab</span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span>                </span><span class="hs-special">(</span><span class="hs-identifier">style</span><span> </span><span class="hs-operator">+</span><span> </span><span class="hs-identifier">sS_LEFT</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="hs-identifier">listBoxControl</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-145"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-146"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-147"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogControl</span><span>
</span><span id="line-148"></span><span class="hs-identifier">listBoxControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-identifier">style</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span> </span><span class="hs-identifier">lab</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-149"></span><span>  </span><span class="hs-identifier">DialogControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Left</span><span> </span><span class="hs-number">0x0083</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">lab</span><span class="hs-special">)</span><span>
</span><span id="line-150"></span><span>                </span><span class="hs-special">(</span><span class="hs-identifier">style</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span class="hs-identifier">comboBoxControl</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-153"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-154"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-155"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogControl</span><span>
</span><span id="line-156"></span><span class="hs-identifier">comboBoxControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-identifier">style</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span> </span><span class="hs-identifier">lab</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-157"></span><span>  </span><span class="hs-identifier">DialogControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Left</span><span> </span><span class="hs-number">0x0085</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">lab</span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>                </span><span class="hs-special">(</span><span class="hs-identifier">style</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="hs-identifier">editControl</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-161"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-162"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-163"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogControl</span><span>
</span><span id="line-164"></span><span class="hs-identifier">editControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-identifier">style</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span> </span><span class="hs-identifier">lab</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-165"></span><span>  </span><span class="hs-identifier">DialogControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Left</span><span> </span><span class="hs-number">0x0081</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">lab</span><span class="hs-special">)</span><span>
</span><span id="line-166"></span><span>                </span><span class="hs-special">(</span><span class="hs-identifier">style</span><span> </span><span class="hs-operator">+</span><span> </span><span class="hs-identifier">eS_LEFT</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span class="hs-identifier">scrollBarControl</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-169"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-170"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-171"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogControl</span><span>
</span><span id="line-172"></span><span class="hs-identifier">scrollBarControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-identifier">style</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span> </span><span class="hs-identifier">lab</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-173"></span><span>  </span><span class="hs-identifier">DialogControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Left</span><span> </span><span class="hs-number">0x0084</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">lab</span><span class="hs-special">)</span><span>
</span><span id="line-174"></span><span>                </span><span class="hs-special">(</span><span class="hs-identifier">style</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">estyle</span><span> </span><span class="hs-identifier">dia_id</span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">ccall</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;diatemp.h getFinalDialog&quot;</span><span>
</span><span id="line-177"></span><span>  </span><span class="hs-identifier">getFinalDialog</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">DIA_TEMPLATE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DTemplateMem</span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">ccall</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;diatemp.h mkDiaTemplate&quot;</span><span>
</span><span id="line-180"></span><span>  </span><span class="hs-identifier">mkDiaTemplate</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WindowStyle</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-181"></span><span>        </span><span class="hs-identifier">LPCWSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCWSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCWSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCWSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">DIA_TEMPLATE</span><span class="hs-special">)</span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span class="hs-identifier">addControl</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">DIA_TEMPLATE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogControl</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span class="hs-identifier">addControl</span><span> </span><span class="hs-identifier">dtemp</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">DialogControl</span><span> </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-identifier">mb_text</span><span> </span><span class="hs-identifier">mb_class</span><span>
</span><span id="line-185"></span><span>                                </span><span class="hs-identifier">style</span><span> </span><span class="hs-identifier">exstyle</span><span>
</span><span id="line-186"></span><span>                                </span><span class="hs-identifier">dia_id</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-187"></span><span>   </span><span class="hs-identifier">prim_text</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">marshall_res</span><span> </span><span class="hs-identifier">mb_text</span><span>
</span><span id="line-188"></span><span>   </span><span class="hs-identifier">prim_class</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">marshall_res</span><span> </span><span class="hs-identifier">mb_class</span><span>
</span><span id="line-189"></span><span>   </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">addDiaControl</span><span> </span><span class="hs-identifier">dtemp</span><span> </span><span class="hs-identifier">prim_text</span><span> </span><span class="hs-identifier">dia_id</span><span> </span><span class="hs-identifier">prim_class</span><span> </span><span class="hs-identifier">style</span><span>
</span><span id="line-190"></span><span>                 </span><span class="hs-identifier">x</span><span> </span><span class="hs-identifier">y</span><span> </span><span class="hs-identifier">cx</span><span> </span><span class="hs-identifier">cy</span><span> </span><span class="hs-identifier">exstyle</span><span>
</span><span id="line-191"></span><span>   </span><span class="hs-identifier">return</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">ccall</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;diatemp.h addDiaControl&quot;</span><span>
</span><span id="line-194"></span><span>  </span><span class="hs-identifier">addDiaControl</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">DIA_TEMPLATE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCWSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCWSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-195"></span><span>        </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">DIA_TEMPLATE</span><span class="hs-special">)</span><span>
</span><span id="line-196"></span><span>
</span><span id="line-197"></span><span class="hs-pragma">{-# CFILES cbits/diatemp.c #-}</span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span class="hs-identifier">marshall_res</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Either</span><span> </span><span class="hs-identifier">ResourceID</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">LPCWSTR</span><span>
</span><span id="line-200"></span><span class="hs-identifier">marshall_res</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Left</span><span> </span><span class="hs-identifier">r</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">mkResource</span><span> </span><span class="hs-identifier">r</span><span>
</span><span id="line-201"></span><span class="hs-identifier">marshall_res</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">s</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">newCWString</span><span> </span><span class="hs-identifier">s</span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span class="hs-comment">-- modeless dialogs</span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span class="hs-identifier">createDialog</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplate</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-206"></span><span class="hs-identifier">createDialog</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-207"></span><span>  </span><span class="hs-identifier">createDialogParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-number">0</span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span class="hs-identifier">createDialogParam</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplate</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-210"></span><span class="hs-identifier">createDialogParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-identifier">init_val</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-211"></span><span>  </span><span class="hs-identifier">c_dia_fn</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">mkDialogClosure</span><span> </span><span class="hs-identifier">dia_fn</span><span>
</span><span id="line-212"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;CreateDialogParam&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-213"></span><span>    </span><span class="hs-identifier">c_CreateDialogParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">maybePtr</span><span> </span><span class="hs-identifier">mb_parent</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">c_dia_fn</span><span> </span><span class="hs-identifier">init_val</span><span>
</span><span id="line-214"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h CreateDialogParamW&quot;</span><span>
</span><span id="line-215"></span><span>  </span><span class="hs-identifier">c_CreateDialogParam</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplate</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">FunPtr</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span class="hs-identifier">createDialogIndirect</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplateMem</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-218"></span><span class="hs-identifier">createDialogIndirect</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-219"></span><span>  </span><span class="hs-identifier">createDialogIndirectParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-number">0</span><span>
</span><span id="line-220"></span><span>
</span><span id="line-221"></span><span class="hs-identifier">createDialogIndirectParam</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplateMem</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-222"></span><span class="hs-identifier">createDialogIndirectParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-identifier">mb_parent</span><span> </span><span class="hs-identifier">dia_fn</span><span> </span><span class="hs-identifier">init_val</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-223"></span><span>  </span><span class="hs-identifier">c_dia_fn</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">mkDialogClosure</span><span> </span><span class="hs-identifier">dia_fn</span><span>
</span><span id="line-224"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;CreateDialogIndirectParam&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-225"></span><span>    </span><span class="hs-identifier">c_CreateDialogIndirectParam</span><span> </span><span class="hs-identifier">inst</span><span> </span><span class="hs-identifier">template</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">maybePtr</span><span> </span><span class="hs-identifier">mb_parent</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">c_dia_fn</span><span> </span><span class="hs-identifier">init_val</span><span>
</span><span id="line-226"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h CreateDialogIndirectParamW&quot;</span><span>
</span><span id="line-227"></span><span>  </span><span class="hs-identifier">c_CreateDialogIndirectParam</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HINSTANCE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">DTemplateMem</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">FunPtr</span><span> </span><span class="hs-identifier">DialogProc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h DefDlgProcW&quot;</span><span>
</span><span id="line-230"></span><span>  </span><span class="hs-identifier">defDlgProc</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WindowMessage</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">LRESULT</span><span>
</span><span id="line-231"></span><span>
</span><span id="line-232"></span><span class="hs-identifier">endDialog</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span class="hs-identifier">endDialog</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-234"></span><span>  </span><span class="hs-identifier">failIfFalse_</span><span> </span><span class="hs-string">&quot;EndDialog&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_EndDialog</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-235"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h EndDialog&quot;</span><span>
</span><span id="line-236"></span><span>  </span><span class="hs-identifier">c_EndDialog</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-237"></span><span>
</span><span id="line-238"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetDialogBaseUnits&quot;</span><span>
</span><span id="line-239"></span><span>  </span><span class="hs-identifier">getDialogBaseUnits</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">LONG</span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span class="hs-identifier">getDlgCtrlID</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-242"></span><span class="hs-identifier">getDlgCtrlID</span><span> </span><span class="hs-identifier">ctl</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-243"></span><span>  </span><span class="hs-identifier">failIfZero</span><span> </span><span class="hs-string">&quot;GetDlgCtrlID&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_GetDlgCtrlID</span><span> </span><span class="hs-identifier">ctl</span><span>
</span><span id="line-244"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetDlgCtrlID&quot;</span><span>
</span><span id="line-245"></span><span>  </span><span class="hs-identifier">c_GetDlgCtrlID</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-246"></span><span>
</span><span id="line-247"></span><span class="hs-identifier">getDlgItem</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-248"></span><span class="hs-identifier">getDlgItem</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">item</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-249"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;GetDlgItem&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_GetDlgItem</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">item</span><span>
</span><span id="line-250"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetDlgItem&quot;</span><span>
</span><span id="line-251"></span><span>  </span><span class="hs-identifier">c_GetDlgItem</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span class="hs-identifier">getDlgItemInt</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Bool</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-254"></span><span class="hs-identifier">getDlgItemInt</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">item</span><span> </span><span class="hs-identifier">signed</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-255"></span><span>  </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">p_trans</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-256"></span><span>  </span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">c_GetDlgItemInt</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">item</span><span> </span><span class="hs-identifier">p_trans</span><span> </span><span class="hs-identifier">signed</span><span>
</span><span id="line-257"></span><span>  </span><span class="hs-identifier">failIfFalse_</span><span> </span><span class="hs-string">&quot;GetDlgItemInt&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">p_trans</span><span>
</span><span id="line-258"></span><span>  </span><span class="hs-identifier">return</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-identifier">res</span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetDlgItemInt&quot;</span><span>
</span><span id="line-260"></span><span>  </span><span class="hs-identifier">c_GetDlgItemInt</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">Bool</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Bool</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">UINT</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="hs-identifier">getDlgItemText</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-263"></span><span class="hs-identifier">getDlgItemText</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">item</span><span> </span><span class="hs-identifier">size</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-264"></span><span>  </span><span class="hs-identifier">allocaArray</span><span> </span><span class="hs-identifier">size</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">p_buf</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-265"></span><span>  </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">failIfZero</span><span> </span><span class="hs-string">&quot;GetDlgItemInt&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_GetDlgItemText</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">item</span><span> </span><span class="hs-identifier">p_buf</span><span> </span><span class="hs-identifier">size</span><span>
</span><span id="line-266"></span><span>  </span><span class="hs-identifier">peekTString</span><span> </span><span class="hs-identifier">p_buf</span><span>
</span><span id="line-267"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetDlgItemTextW&quot;</span><span>
</span><span id="line-268"></span><span>  </span><span class="hs-identifier">c_GetDlgItemText</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-269"></span><span>
</span><span id="line-270"></span><span class="hs-identifier">getNextDlgGroupItem</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">BOOL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-271"></span><span class="hs-identifier">getNextDlgGroupItem</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">ctl</span><span> </span><span class="hs-identifier">previous</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-272"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;GetNextDlgGroupItem&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_GetNextDlgGroupItem</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">ctl</span><span> </span><span class="hs-identifier">previous</span><span>
</span><span id="line-273"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetNextDlgGroupItem&quot;</span><span>
</span><span id="line-274"></span><span>  </span><span class="hs-identifier">c_GetNextDlgGroupItem</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">BOOL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span class="hs-identifier">getNextDlgTabItem</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">BOOL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-277"></span><span class="hs-identifier">getNextDlgTabItem</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">ctl</span><span> </span><span class="hs-identifier">previous</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-278"></span><span>  </span><span class="hs-identifier">failIfNull</span><span> </span><span class="hs-string">&quot;GetNextDlgTabItem&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_GetNextDlgTabItem</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">ctl</span><span> </span><span class="hs-identifier">previous</span><span>
</span><span id="line-279"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetNextDlgTabItem&quot;</span><span>
</span><span id="line-280"></span><span>  </span><span class="hs-identifier">c_GetNextDlgTabItem</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">BOOL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">HWND</span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h IsDialogMessageW&quot;</span><span>
</span><span id="line-283"></span><span>  </span><span class="hs-identifier">isDialogMessage</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPMSG</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span class="hs-identifier">mapDialogRect</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPRECT</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-286"></span><span class="hs-identifier">mapDialogRect</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">p_rect</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-287"></span><span>  </span><span class="hs-identifier">failIfFalse_</span><span> </span><span class="hs-string">&quot;MapDialogRect&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_MapDialogRect</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">p_rect</span><span>
</span><span id="line-288"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h MapDialogRect&quot;</span><span>
</span><span id="line-289"></span><span>  </span><span class="hs-identifier">c_MapDialogRect</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPRECT</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Bool</span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span class="hs-comment">-- No MessageBox* funs in here just yet.</span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h SendDlgItemMessageW&quot;</span><span>
</span><span id="line-294"></span><span>  </span><span class="hs-identifier">sendDlgItemMessage</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WindowMessage</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPARAM</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">LONG</span><span>
</span><span id="line-295"></span><span>
</span><span id="line-296"></span><span class="hs-identifier">setDlgItemInt</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">UINT</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">BOOL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-297"></span><span class="hs-identifier">setDlgItemInt</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">item</span><span> </span><span class="hs-identifier">value</span><span> </span><span class="hs-identifier">signed</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-298"></span><span>  </span><span class="hs-identifier">failIfFalse_</span><span> </span><span class="hs-string">&quot;SetDlgItemInt&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_SetDlgItemInt</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">item</span><span> </span><span class="hs-identifier">value</span><span> </span><span class="hs-identifier">signed</span><span>
</span><span id="line-299"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h SetDlgItemInt&quot;</span><span>
</span><span id="line-300"></span><span>  </span><span class="hs-identifier">c_SetDlgItemInt</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">UINT</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">BOOL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Bool</span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span class="hs-identifier">setDlgItemText</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span class="hs-identifier">setDlgItemText</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">item</span><span> </span><span class="hs-identifier">str</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-304"></span><span>  </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">str</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">c_str</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-305"></span><span>  </span><span class="hs-identifier">failIfFalse_</span><span> </span><span class="hs-string">&quot;SetDlgItemText&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_SetDlgItemText</span><span> </span><span class="hs-identifier">dlg</span><span> </span><span class="hs-identifier">item</span><span> </span><span class="hs-identifier">c_str</span><span>
</span><span id="line-306"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h SetDlgItemTextW&quot;</span><span>
</span><span id="line-307"></span><span>  </span><span class="hs-identifier">c_SetDlgItemText</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HWND</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Bool</span><span>
</span><span id="line-308"></span><span>
</span><span id="line-309"></span><span class="hs-identifier">dS_3DLOOK</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-310"></span><span class="hs-identifier">dS_3DLOOK</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">4</span><span>
</span><span id="line-311"></span><span class="hs-identifier">dS_ABSALIGN</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-312"></span><span class="hs-identifier">dS_ABSALIGN</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1</span><span>
</span><span id="line-313"></span><span class="hs-identifier">dS_CENTER</span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-314"></span><span class="hs-identifier">dS_CENTER</span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">2048</span><span>
</span><span id="line-315"></span><span class="hs-identifier">dS_CENTERMOUSE</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-316"></span><span class="hs-identifier">dS_CENTERMOUSE</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">4096</span><span>
</span><span id="line-317"></span><span class="hs-identifier">dS_CONTEXTHELP</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-318"></span><span class="hs-identifier">dS_CONTEXTHELP</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">8192</span><span>
</span><span id="line-319"></span><span class="hs-identifier">dS_CONTROL</span><span>            </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-320"></span><span class="hs-identifier">dS_CONTROL</span><span>            </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1024</span><span>
</span><span id="line-321"></span><span class="hs-identifier">dS_FIXEDSYS</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-322"></span><span class="hs-identifier">dS_FIXEDSYS</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">8</span><span>
</span><span id="line-323"></span><span class="hs-identifier">dS_LOCALEDIT</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-324"></span><span class="hs-identifier">dS_LOCALEDIT</span><span>          </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">32</span><span>
</span><span id="line-325"></span><span class="hs-identifier">dS_MODALFRAME</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-326"></span><span class="hs-identifier">dS_MODALFRAME</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">128</span><span>
</span><span id="line-327"></span><span class="hs-identifier">dS_NOFAILCREATE</span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-328"></span><span class="hs-identifier">dS_NOFAILCREATE</span><span>       </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">16</span><span>
</span><span id="line-329"></span><span class="hs-identifier">dS_NOIDLEMSG</span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-330"></span><span class="hs-identifier">dS_NOIDLEMSG</span><span>          </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">256</span><span>
</span><span id="line-331"></span><span class="hs-identifier">dS_SETFONT</span><span>            </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-332"></span><span class="hs-identifier">dS_SETFONT</span><span>            </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">64</span><span>
</span><span id="line-333"></span><span class="hs-identifier">dS_SETFOREGROUND</span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-334"></span><span class="hs-identifier">dS_SETFOREGROUND</span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">512</span><span>
</span><span id="line-335"></span><span class="hs-identifier">dS_SYSMODAL</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowStyle</span><span>
</span><span id="line-336"></span><span class="hs-identifier">dS_SYSMODAL</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">2</span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span class="hs-pragma">{-# LINE 325 &quot;libraries\\Win32\\Graphics\\Win32\\Dialogue.hsc&quot; #-}</span><span>
</span><span id="line-325"></span><span>
</span><span id="line-326"></span><span class="hs-identifier">dM_GETDEFID</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowMessage</span><span>
</span><span id="line-327"></span><span class="hs-identifier">dM_GETDEFID</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1024</span><span>
</span><span id="line-328"></span><span class="hs-identifier">dM_REPOSITION</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowMessage</span><span>
</span><span id="line-329"></span><span class="hs-identifier">dM_REPOSITION</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1026</span><span>
</span><span id="line-330"></span><span class="hs-identifier">dM_SETDEFID</span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowMessage</span><span>
</span><span id="line-331"></span><span class="hs-identifier">dM_SETDEFID</span><span>           </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1025</span><span>
</span><span id="line-332"></span><span class="hs-identifier">wM_CTLCOLORDLG</span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowMessage</span><span>
</span><span id="line-333"></span><span class="hs-identifier">wM_CTLCOLORDLG</span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">310</span><span>
</span><span id="line-334"></span><span class="hs-identifier">wM_CTLCOLORMSGBOX</span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WindowMessage</span><span>
</span><span id="line-335"></span><span class="hs-identifier">wM_CTLCOLORMSGBOX</span><span>     </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">306</span><span>
</span><span id="line-336"></span><span>
</span><span id="line-337"></span><span class="hs-pragma">{-# LINE 333 &quot;libraries\\Win32\\Graphics\\Win32\\Dialogue.hsc&quot; #-}</span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-335"></span><span class="hs-comment">-- End</span><span>
</span><span id="line-336"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-337"></span></pre></body></html>